﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MC.RideEvent.Mvc.Models.Entity;
using MC.RideEvent.Mvc.Models.ViewModel;
using AutoMapper;

namespace MC.RideEvent.Mvc.Models.Repository
{
    public class VehiculeBrandRepository : IVehiculeBrandRepository
    {
        private RideEventDBEntities _context;

        public VehiculeBrandRepository()
        {
            _context = new RideEventDBEntities();
        }

        public List<VehiculeBrandModel> ListBrand()
        {
            var list = (from b in _context.VehiculeBrands
                       select b).ToList();
            
            var datas = Mapper.Map<List<VehiculeBrand>, List<VehiculeBrandModel>>(list);

            return datas;
        }
    }
}
